package com.feicheng.controller.wx;

import com.alibaba.fastjson.JSONObject;
import com.feicheng.common.constant.Constant;
import com.feicheng.common.result.ResultInfo;
import com.feicheng.service.IFLoginService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController("/wx/login")
@RequestMapping("/wx/login")
public class LoginController {

    @Resource(name="client-login")
    Map<String, IFLoginService> clientLoginService;

    @GetMapping("/jscode")
    public ResultInfo jscode(String code) {
        JSONObject param = new JSONObject();
        param.put(Constant.WX.PARAM.CODE, code);
        return clientLoginService.get(Constant.LOGIN_TYPE.WX_JSCODE).login(param.toJSONString());
    }




}
